package com.marchsoft.musicalstore.repository;

import com.marchsoft.musicalstore.entity.User;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Optional;

public interface UserRepository extends JpaRepository<User,Integer> {
//    List<User> findAllByStatus(Integer status);
//    User findByAccountLike()
    //通过用户查询用户信息
    User findById(int id);

//    @Modifying
//    @Query("update User u set u.headImg = :head_img,u.nickName = :nickName,u.phone = :phone,u.password = :password where u.id = :id")
//    int update(String head_img, String nickName,String phone,String password,int id);
}
